<template>
	<!-- 歌曲评论 -->
	<view class="content">
		<!-- 头部 -->
		<view class="comments-title">
			<view class="d-flex align-items-center">
				<u-icon @click="goback" name="arrow-down" size="30"></u-icon>
				<text style="margin-left: 20upx;">评论( {{songId}}  )</text>
			</view>
			<u-icon name="share" size="50"></u-icon>
		</view>
		<!-- 歌手照片 -->
		<view class="comments-img" @click="goback">
			<view>
				<u-image width="200upx" :fade="true" duration="450" border-radius="10" mode="widthFix" :src="pic">
					<view slot="error" style="font-size: 24rpx;">加载失败</view>
				</u-image>
				<view class="imgtext">
					<text>{{songs}}</text>
					<text style="color: #617C87;font-size: 20upx;">{{author}}</text>
				</view>
			</view>
			<view>
				<!-- <uni-icons type="arrowright"></uni-icons> -->
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex'
	import {getMusicComment} from '@/network/recommen.js'
	export default  {
		computed: {
			...mapState(['songId', 'songs', 'author', 'pic'])
		},
		data() {
			return {

			}
		},
		methods: {
			//返回
			goback() {
				uni.navigateBack({
					data: 1
				})
			},
			_getMusicComment(){
				getMusicComment().then(res => {
					console.log(res);
				})
			}
		},
		onLoad() {
			this._getMusicComment()
		}
	}
</script>

<style scoped lang="scss">
	//头部
	.comments-title {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 30upx 30upx;
		box-sizing: border-box;
		margin-top: 10px;
	}

	.comments-img {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0 30upx;

		>view {
			display: flex;
			align-items: center;

			.imgtext {
				margin-left: 20upx;
				display: flex;
				flex-direction: column;

				text {
					width: 100%;
					display: block;
					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
					font-weight: 600;
				}
			}
		}
	}
 </style>
